﻿package{
	import flash.display.MovieClip;
	import flash.display.Sprite;
	public class number extends Sprite{
		var num:int;
		var scale:Number=1;
		var scoreboard:Array=new Array();
		public function number():void{

		}
		public function setNumber(n:String):void{
			//0---48
			while (scoreboard.length<n.length){
				var tempSB:score=new score();
				tempSB.scaleX=scale;
				tempSB.scaleY=scale;
				scoreboard.push(tempSB);
				this.addChild(tempSB);
			}
			for (var i:int=1;i<=scoreboard.length;i++){
				scoreboard[i-1].x=i*20;
				if (i<=n.length){
					scoreboard[i-1].gotoAndStop(n.charCodeAt(i-1)-47);
					scoreboard[i-1].visible=true;
				}else{
					scoreboard[i-1].visible=false;
				}
			}
		}
		public function setScale(n:Number):void{
			scale=n;
			for(var i:String in scoreboard){
				scoreboard[i].scaleX=n;
				scoreboard[i].scaleY=n;
			}
		}
	}
}
		